package com.Hermes.Omega;

import it.unisa.dia.gas.jpbc.Element;
import it.unisa.dia.gas.jpbc.Field;
import it.unisa.dia.gas.jpbc.Pairing;

import java.math.BigInteger;


public class PK {

    private final BigInteger n;
    private final Field<Element> _G;
    private final Field<Element> _G1;
    private final Pairing e;
    private final Element g;
    private final Element h;
    private final Element g1;
    private final Element h1;
    public PK(BigInteger _n, Field<Element> _g,
              Field<Element> _g1, Element _g2, Element _h, Pairing _ee,Element h1,Element g1) {
        this.n = _n;
        _G = _g;
        _G1 = _g1;
        e = _ee;
        this.g = _g2.getImmutable();
        this.h = _h.getImmutable();
        this.h1 = h1.getImmutable();
        this.g1 = g1.getImmutable();
    }

    public Pairing getE() {
        return e;
    }

    public Element getG1() {
        return g1;
    }

    public Element getH1() {
        return h1;
    }

    public BigInteger getN() {
        return n;
    }

    public Element getPair(Element A, Element B) {
        return e.pairing(A.getImmutable(), B.getImmutable()).getImmutable();
    }


    public Field get_G() {
        return _G;
    }

    public Field get_G1() {
        return _G1;
    }

    public Element getG() {
        return g.getImmutable();
    }

    public Element getH() {
        return h.getImmutable();
    }
}
